//
//  UIControllerCenter.m
//  WeCommunity
//
//  Created by mac on 2017/6/14.
//  Copyright © 2017年 lzy. All rights reserved.
//

#import "UIControllerCenter.h"
#import "CommunityListViewController.h"
#import "MineHomeViewController.h"
#import "CommunityCopyViewController.h"

static UIControllerCenter * uiControllerCenter;

@implementation UIControllerCenter

+(UIControllerCenter *)shared
{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        
        uiControllerCenter = [[UIControllerCenter alloc] init];
        
        uiControllerCenter.rootTabBarController = [[RootTabBarController alloc] init];
        
    });
    
    return uiControllerCenter;
}

-(UIViewController *)creatWithRootViewController
{
    //状态栏
    [UITool setStatusBarIsWhite:YES];
    
    //
    [UITool setSDWebDecompression:NO];
    
    //新鲜
    CommunityListViewController * comListVC = [[CommunityListViewController alloc] init];
    [self.rootTabBarController addChildViewController:comListVC
                                                title:KNSLocal(@"新鲜")
                                      showTabBarTitle:YES
                                                image:[UIImage imageNamed:@"TabHome"]
                                        selectedImage:[UIImage imageNamed:@"TabHome_sel"]];
    
    //社区
    CommunityCopyViewController * comCopyVC = [[CommunityCopyViewController alloc] init];
    [self.rootTabBarController addChildViewController:comCopyVC
                                                title:KNSLocal(@"社区")
                                      showTabBarTitle:YES
                                                image:[UIImage imageNamed:@"TabCommunity"]
                                        selectedImage:[UIImage imageNamed:@"TabCommunity_sel"]];
    
    //我的
    MineHomeViewController * mineVC = [[MineHomeViewController alloc] init];
    [self.rootTabBarController addChildViewController:mineVC
                                                title:KNSLocal(@"mineTitle")
                                      showTabBarTitle:YES
                                                image:[UIImage imageNamed:@"TabMine"]
                                        selectedImage:[UIImage imageNamed:@"TabMine_sel"]];
    
    return self.rootTabBarController;
}

@end
